﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片提示</title>
 <!--   引入jQuery -->
<script src="jquery-1.11.3.min.js" type="text/javascript" ></script>
<style>

li{list-style: none;float: left;border: 1px solid #000;margin: 10px;}
#big_pic{
	border: 2px solid #000;
	width: 396px;
	height: 296px;
	position: absolute;
	display:none;
}
#big_pic img{
	height: 276px;
	width: 396px;
}
#big_pic div{
	background: #000;
	color: #fff;
	width: 396px;
	height: 20px;
}
</style>
<script>
	$(function(){
		var x = 10,y = 10;
		$("#top a").mouseover(function(e){
			this.myTitle = this.title;
			this.title = "";
			var big_pic = "<div id='big_pic'><img src='"+this.href+" '/><div>"+this.myTitle+"</div></div>"
			$("body").append(big_pic);
			$("#big_pic").css({
				"left" : e.pageX + x + "px",
				"top" : e.pageY + y + "px"
			}).show("fast");
		}).mousemove(function(e){
			$("#big_pic").css({
				"left" : e.pageX + x + "px",
				"top" : e.pageY  + y + "px"
			});
		}).mouseout(function(){
			$("#big_pic").remove();
			this.title = this.myTitle;
		});
	});
</script>

</head>
<body>
	<br/><br/><br/><br/>
	<div id="top">
		<h3>有效果</h3>
		<ul>
			<li><a href="images/apple_1_bigger.jpg" class="tooltip" title="图片1" ><img src="images/apple_1.jpg" alt="图片1" /></a></li>
			<li><a href="images/apple_2_bigger.jpg" class="tooltip" title="图片2" ><img src="images/apple_2.jpg" alt="图片2" /></a></li>
			<li><a href="images/apple_3_bigger.jpg" class="tooltip" title="图片3" ><img src="images/apple_3.jpg" alt="图片3" /></a></li>
			<li><a href="images/apple_4_bigger.jpg" class="tooltip" title="图片4" ><img src="images/apple_4.jpg" alt="图片4" /></a></li>
		</ul>
	</div>
	<br/><br/><br/><br/>
	<br/><br/><br/><br/>
	<br/><br/><br/><br/>
	<div>
		<h3>没效果</h3>
		<ul>
			<li><a href="images/apple_1_bigger.jpg" class="tooltip" title="图片1" ><img src="images/apple_1.jpg" alt="图片1" /></a></li>
			<li><a href="images/apple_1_bigger.jpg" class="tooltip" title="图片2" ><img src="images/apple_2.jpg" alt="图片2" /></a></li>
			<li><a href="images/apple_1_bigger.jpg" class="tooltip" title="图片3" ><img src="images/apple_3.jpg" alt="图片3" /></a></li>
			<li><a href="images/apple_1_bigger.jpg" class="tooltip" title="图片4" ><img src="images/apple_4.jpg" alt="图片4" /></a></li>
		</ul>
	</div>
	<!-- <div id="big_pic">
		<img />
		<div></div>
	</div> -->
</body>
</html>
